package com.yzw.phonestoreservice.exception;

import com.yzw.phonecommen.common.BusinessMsgEnum;
import lombok.Data;

/**
 * @BelongsProject: springbootdome
 * @BelongsPackage: com.yu.sbmpsum1.exception
 * @Author: yanhongwei
 * @CreateTime: 2022-10-30  17:26
 * @Description: TODO 自定义异常
 * @Version: 1.0
 */
@Data
public class BusinessErrorException  extends RuntimeException {
    /**
     * 异常码
     */
    private Integer code;
    /**
     * 异常提示信息
     */
    private String message;

    public BusinessErrorException(BusinessMsgEnum businessMsgEnum) {
        this.code = businessMsgEnum.getCode();
        this.message = businessMsgEnum.getMessage();
    }
}
